this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(e,t,n,i,s){"use strict";var a=function(e){babelHelpers.inherits(i,e);function i(e){var a;babelHelpers.classCallCheck(this,i);a=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this,e));a.uploadButton.layout.innerText=BX.Landing.Loc.getMessage("LANDING_ICONS_FIELD_BUTTON_REPLACE");a.editButton.layout.hidden=true;a.clearButton.layout.hidden=true;a.dropzone.removeEventListener("dragover",a.onDragOver);a.dropzone.removeEventListener("dragleave",a.onDragLeave);a.dropzone.removeEventListener("drop",a.onDrop);a.preview.removeEventListener("dragenter",a.onImageDragEnter);a.options=new s.IconOptionsCard;t.Dom.append(a.options.getLayout(),a.right);a.onOptionClick=a.onOptionClick.bind(babelHelpers.assertThisInitialized(a));a.options.subscribe("onChange",a.onOptionClick);var o=a.content.classList;var r=[];n.IconPanel.getLibraries().then(function(e){if(e.length===0){this.uploadButton.disable()}else{e.forEach((function(e){e.categories.forEach((function(e){e.items.forEach((function(e){var n="";if(t.Type.isObject(e)){n=e.options.join(" ")}else{n=e}var i=n.split(" ");i.forEach((function(e){if(o.indexOf(e)!==-1&&r.indexOf(e)===-1){r.push(e)}}))}))}))}));this.icon.innerHTML='<span class="test '+r.join(" ")+'"></span>'}this.options.setOptionsByItem(r)}.bind(babelHelpers.assertThisInitialized(a)));return a}babelHelpers.createClass(i,[{key:"onUploadClick",value:function e(t){var i=this;t.preventDefault();n.IconPanel.getInstance().show().then((function(e){i.options.setOptions(e.iconOptions,e.iconClassName);i.setValue({type:"icon",classList:e.iconClassName.split(" ")})}))}},{key:"onOptionClick",value:function e(t){var n=t.getData().option.split(" ");this.setValue({type:"icon",classList:n})}},{key:"isChanged",value:function e(){return this.getValue().classList.some((function(e){return this.content.classList.indexOf(e)===-1}),this)}},{key:"getValue",value:function e(){var n=this.classList;if(this.selector){var i=this.selector.split("@")[0].replace(".","");n=t.Runtime.clone(this.classList).concat([i]);n=BX.Landing.Utils.arrayUnique(n)}return{type:"icon",src:"",id:-1,alt:"",classList:n,url:Object.assign({},this.url.getValue(),{enabled:true})}}},{key:"reset",value:function e(){this.setValue({type:"icon",src:"",id:-1,alt:"",classList:[],url:""})}}]);return i}(i.Image);e.Icon=a})(this.BX.Landing.UI.Field=this.BX.Landing.UI.Field||{},BX,BX.Landing.UI.Panel,BX.Landing.UI.Field,BX.Landing.UI.Card);
//# sourceMappingURL=icon.bundle.map.js